package com.xue.springboot001.exception;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

@Slf4j
@ControllerAdvice
public class GlobalMVCException {

    @ExceptionHandler(value = {ArithmeticException.class,NullPointerException.class})
    public String handlerArithmeticException(Exception e){
        log.info("异常是:{}",e);
        return "/login";
    }
}
